package com.wm.composite.ruletree.service.engine.impl;

import com.wm.composite.ruletree.model.aggregates.TreeRich;
import com.wm.composite.ruletree.model.vo.EngineResult;
import com.wm.composite.ruletree.model.vo.TreeNode;
import com.wm.composite.ruletree.service.engine.EngineBase;

import java.util.Map;

/**
 * @ClassName: TreeEngineHandle
 * @Description: 决策引擎的实现
 * @Author: WM
 * @Date: 2023/4/24 17:37
 */
public class TreeEngineHandle extends EngineBase {
    @Override
    public EngineResult process(long treeId, String userId, TreeRich treeRich,
                                Map<String, String> decisionMatter) {
        // 决策流程
        TreeNode treeNode = engineDecisionMaker(treeRich, treeId, userId, decisionMatter);
        return new EngineResult(userId, treeId, treeNode.getTreeNodeId(), treeNode.getNodeValue());
    }
}
